<template >
        <div class="son-div">
            <h2>子组件</h2>
            <h3>我有一个：{{toy}}</h3>
            <h3>老爸有一辆{{car}}</h3> 
            <button @click="sendToy(toy)">把玩具给父亲</button>
        </div>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
//数据
let toy = ref("奥特曼")
//声明接受props
defineProps(["car","sendToy"])
</script>
<style scoped>
.son-div{
       background-color: aquamarine;
       width: 500px;
       height: 250px;
       margin: 10px;
       border: solid gray 1px;
       border-radius: 15px;
}
</style>